package com.xiaoyu.izf.controller;

import com.xiaoyu.izf.aspect.RequestAuth;
import com.xiaoyu.izf.config.MyConfig;
import com.xiaoyu.izf.config.SysConfig;
import com.xiaoyu.izf.service.AppUpdateInfoService;
import com.xiaoyu.izf.service.DataGetService;
import com.xiaoyu.izf.service.UserInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/test")
public class TestController {
    @Autowired
    private DataGetService dataGetService;
    @Autowired
    private UserInfoService userInfoService;
    @Autowired
    private MyConfig myConfig;
    @Autowired
    private AppUpdateInfoService appUpdateInfoService;

    @RequestMapping("/t1")
//    @RequestAuth
    public String t1(){

        System.out.println("sss");
        System.out.println("======"+myConfig.getHost());
        //dataGetService.userTokenGet();
        //dataGetService.newsListGet("0aff8biZRApk/qgaAU3fgKVzaWqygy2Mtxib0wY6R8FR4l5N1w");
       // dataGetService.newsOne("0aff8biZRApk/qgaAU3fgKVzaWqygy2Mtxib0wY6R8FR4l5N1w",299432);
        System.out.println("---------------------:"+ SysConfig.isTest);
        return "t1sssddss";
    }

    @RequestMapping("/t2")
    public String t2(){
        int t = userInfoService.regUserCount("");
        System.out.println(t);
        return "t";
    }

    @RequestMapping("/t3")
    public String t3(){
        appUpdateInfoService.findLastAndroidVersion();

        return "t3";
    }
}
